package com.useeinfo.oa.modules.wuHanCommon.base.result;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.useeinfo.oa.modules.wuHanCommon.base.result.enums.ResultEnums_Wh;

import java.io.Serializable;

public class ResultDto_Wh<T> implements Serializable {
    /**
     * 返回状态码
     */
    private int err;
    /**
     * 返回提示
     */
    private String msg;
    /**
     * 请求结果
     */
    private T data;

    public int getErr() {
        return err;
    }

    public void setErr(int err) {
        this.err = err;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    /**
     * 判断当前返回结果是否成功
     * @return
     */
    @JsonIgnore
    public boolean isSuccess(){
        return this.err == ResultEnums_Wh.SUCCESS.getCode();
    }
}
